package com.consumer.service.impl;

import com.consumer.service.ThreadPoolService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional(rollbackFor = Exception.class)
public class ThreadPoolServiceImpl implements ThreadPoolService {

    @Resource
    MigrationService migrationService;

    @Override
    @Async
    public void threadTest(String systemId) {
        migrationService.migrateDemand(systemId);
    }

    @Override
    public void threadTest2(String systemId) {
        migrationService.migrateProductDemand(systemId);
        migrationService.migrateProductBucket(systemId);
    }
}
